/*
 * Arrete.cpp
 *
 *  Created on: Jun 8, 2013
 *      Author: juliendubois
 */

#include "Arrete.h"

Arrete::Arrete(Coordonnees* coord, Cardinalite_2D card) {
	this->coord = coord;
	this->card = card;
}

Arrete::~Arrete() {
}

bool Arrete::operator ==(const Arrete& arr) const {
	return ((((*(this->coord)) == (*(arr.coord))) && (this->card == arr.card)) || ((this->coord->getVoisin(this->card) == *(arr.coord)) && estOppose(arr.card, this->card)));
}

bool Arrete::operator !=(const Arrete& arr) const {
	return ((((*(this->coord)) != (*(arr.coord))) || (this->card != arr.card)) && ((this->coord->getVoisin(this->card) != *(arr.coord)) || !estOppose(arr.card, this->card)));
}

bool Arrete::operator <(const Arrete& arr) const {
	return (*(this->coord) != *(arr.coord)) ?	(*(this->coord) < *(arr.coord)) :
												(this->card < arr.card);
}

bool Arrete::operator <=(const Arrete& arr) const {
	return (*(this->coord) != *(arr.coord)) ?	(*(this->coord) < *(arr.coord)) :
												(this->card <= arr.card);
}

bool Arrete::operator >(const Arrete& arr) const {
	return (*(this->coord) != *(arr.coord)) ?	(*(this->coord) > *(arr.coord)) :
												(this->card > arr.card);
}

bool Arrete::operator >=(const Arrete& arr) const {
	return (*(this->coord) != *(arr.coord)) ?	(*(this->coord) > *(arr.coord)) :
												(this->card >= arr.card);
}
